﻿CREATE TABLE [dbo].[Project_copy] (
    [Id]                  INT              IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL,
    [ProjectId]           UNIQUEIDENTIFIER DEFAULT (newid()) ROWGUIDCOL NULL,
    [OrderId]             UNIQUEIDENTIFIER NULL,
    [CusId]               UNIQUEIDENTIFIER NULL,
    [CusName]             NVARCHAR (200)   NULL,
    [ProductCategoryId]   INT              NULL,
    [ProductCategoryName] NVARCHAR (50)    NULL,
    [ProductId]           INT              DEFAULT ((0)) NULL,
    [ProductName]         NVARCHAR (50)    NULL,
    [SupplierId]          INT              DEFAULT ((0)) NULL,
    [SupplierName]        NVARCHAR (50)    NULL,
    [CostPrice]           DECIMAL (18, 2)  NULL,
    [SalePrice]           DECIMAL (18, 2)  NULL,
    [Description]         VARCHAR (MAX)    NULL,
    [TypeId]              INT              NULL,
    [TypeName]            NVARCHAR (50)    NULL,
    [IsFinish]            BIT              DEFAULT ((0)) NULL,
    [CompanyId]           INT              NULL,
    [DeptId]              INT              DEFAULT ((0)) NULL,
    [Salesman]            NVARCHAR (50)    NULL,
    [SalesmanAccount]     NVARCHAR (50)    NULL,
    [CreateUser]          NVARCHAR (50)    NULL,
    [CreateDate]          DATETIME         NULL,
    [FinishDate]          DATETIME         NULL,
    [ExecDepartmentId]    INT              DEFAULT ((0)) NULL,
    [ExecPerson]          NVARCHAR (50)    NULL,
    [ExecPersonName]      NVARCHAR (50)    NULL,
    [FinanceAudit]        INT              NULL,
    [FinanceAuditDate]    DATETIME         NULL,
    [SCateOneId]          INT              NULL,
    [SCateTwoId]          INT              NULL,
    [SubjectId]           INT              NULL,
    [UpTime]              DATETIME         DEFAULT (getdate()) NULL,
    [NOE_Flag]            INT              DEFAULT ((0)) NOT NULL,
    [MoveUserId]          VARCHAR (30)     NULL,
    [MoveCompanyId]       INT              DEFAULT ((0)) NOT NULL,
    [IsHedge]             SMALLINT         DEFAULT ((0)) NOT NULL,
    [reserve1]            INT              DEFAULT ((0)) NULL,
    [reserve2]            INT              DEFAULT ((0)) NULL,
    [reserve3]            DECIMAL (18, 2)  DEFAULT ((0)) NULL,
    [reserve4]            DECIMAL (18, 2)  DEFAULT ((0)) NULL,
    [reserve5]            VARCHAR (50)     DEFAULT ('') NULL,
    [reserve6]            VARCHAR (50)     DEFAULT ('') NULL,
    [reserve7]            DATETIME         NULL,
    [reserve8]            DATETIME         NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC) WITH (FILLFACTOR = 70)
);


GO
CREATE NONCLUSTERED INDEX [IX_Project_OrderId]
    ON [dbo].[Project_copy]([OrderId] ASC) WITH (FILLFACTOR = 70);


GO
CREATE NONCLUSTERED INDEX [IX_Project_ExecPerson]
    ON [dbo].[Project_copy]([ExecPerson] ASC) WITH (FILLFACTOR = 70);


GO
CREATE NONCLUSTERED INDEX [IX_Project_SalesmanAccount]
    ON [dbo].[Project_copy]([SalesmanAccount] ASC) WITH (FILLFACTOR = 70);


GO
CREATE NONCLUSTERED INDEX [IX_Project_CreateUser]
    ON [dbo].[Project_copy]([CreateUser] ASC) WITH (FILLFACTOR = 70);


GO
CREATE NONCLUSTERED INDEX [IX_Project_CreateDate]
    ON [dbo].[Project_copy]([CreateDate] ASC) WITH (FILLFACTOR = 70);


GO
CREATE NONCLUSTERED INDEX [IX_Project_FinishDate]
    ON [dbo].[Project_copy]([FinishDate] ASC) WITH (FILLFACTOR = 70);


GO
CREATE NONCLUSTERED INDEX [IX_Project_ProjectId]
    ON [dbo].[Project_copy]([ProjectId] ASC) WITH (FILLFACTOR = 70);


GO
CREATE NONCLUSTERED INDEX [IX_Finish_Item]
    ON [dbo].[Project_copy]([IsFinish] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_Hedge_Item]
    ON [dbo].[Project_copy]([IsHedge] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_NOE_FLAG]
    ON [dbo].[Project_copy]([NOE_Flag] ASC);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'项目分析完成日期(默认为空)', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Project_copy', @level2type = N'COLUMN', @level2name = N'CreateDate';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'该数据项的创建时间(新加的字段、原CreateDate字段)', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Project_copy', @level2type = N'COLUMN', @level2name = N'UpTime';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'非企成单标志 1非企 0常规', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Project_copy', @level2type = N'COLUMN', @level2name = N'NOE_Flag';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'项目转移后的接手人', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Project_copy', @level2type = N'COLUMN', @level2name = N'MoveUserId';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'项目转移后的公司id 0 代表未转移', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Project_copy', @level2type = N'COLUMN', @level2name = N'MoveCompanyId';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'0 正常、-1 被对冲或对冲数据', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Project_copy', @level2type = N'COLUMN', @level2name = N'IsHedge';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'保留1', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Project_copy', @level2type = N'COLUMN', @level2name = N'reserve1';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'保留2', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Project_copy', @level2type = N'COLUMN', @level2name = N'reserve2';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'保留3', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Project_copy', @level2type = N'COLUMN', @level2name = N'reserve3';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'保留4', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Project_copy', @level2type = N'COLUMN', @level2name = N'reserve4';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'保留5', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Project_copy', @level2type = N'COLUMN', @level2name = N'reserve5';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'保留6', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Project_copy', @level2type = N'COLUMN', @level2name = N'reserve6';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'成单审核日期', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Project_copy', @level2type = N'COLUMN', @level2name = N'reserve7';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'保留6', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Project_copy', @level2type = N'COLUMN', @level2name = N'reserve8';

